package com.kfm.map;

public class Person<E> {

    private E e;



    public void set(E e) {
        this.e = e;
    }

    public E get() {
        return e;
    }

    public <T> void marry(T t) {
        System.out.println(e + "和" + t + "结婚");
    }
}

class Test {

    public static void main(String[] args) {
        // Person<GF> p1 = new Person<>();
        // GF gf = p1.get();
        //
        //
        // Person<BF> p2 = new Person<>();
        // BF bf = p2.get();
        Person<Girl> girl = new Person<>();
        girl.set(new Girl("pomelo", 26));
        girl.marry(new BF("王鹤棣", 27));

    }
}
